package com.game.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.game.entity.BaseEntity;


import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import lombok.Data;
import org.springframework.util.StringUtils;

/**
 * 汇率设置
 *
 * @author damow
 * @email *****@mail.com
 * @date 2022-08-16 20:49:56
 */
@Data
@TableName("sys_exchange_rate")
public class ExchangeRate extends BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * ID
	 */
	@TableId(value = "id",type = IdType.AUTO)
	private Integer id;

	/**
	 * 转换币种
	 */
	@TableField("froms")
	private String froms;

	/**
	 * 被转换币种
	 */
	@TableField("tos")
	private String tos;

	/**
	 * 汇率
	 */
	@TableField("rate")
	private BigDecimal rate;

	/**
	 * 被转换币种符号
	 */
	@TableField("code")
	private String code;

	/**
	 * 状态
	 */
	@TableField("status")
	private Integer status;

	/**
	 * 排序
	 */
	@TableField("sort")
	private Integer sort;

	/**
	 * 描述
	 */
	@TableField("description")
	private String description;

	/**
	 * 创建时间
	 */
	@TableField("created_at")
	private Date createdAt;

	/**
	 * 修改时间
	 */
	@TableField("update_time")
	private Date updateTime;
	@TableField(exist = false)
	private Integer rateStatus;

	public String getCode() {
		return StringUtils.isEmpty(code) ? "" : code;
	}
}
